package com.freightoa.sgl

import android.content.Intent
import android.os.Bundle
import androidx.activity.ComponentActivity
import androidx.activity.enableEdgeToEdge
import com.freightoa.foundation.app.MMKVUtils
import com.freightoa.foundation.app.MMKVkEY
import com.freightoa.sgl_login.presentation.screen.LoginActivity
import com.lhgray.sglhome.presentation.ui.activity.HomeActivity
import dagger.hilt.android.AndroidEntryPoint

@AndroidEntryPoint
class MainActivity : ComponentActivity() {
    override fun onCreate(savedInstanceState: Bundle?) {
        super.onCreate(savedInstanceState)
        enableEdgeToEdge()
        val userId = MMKVUtils.getString(MMKVkEY.userId, "")
        if (userId.isEmpty()) {
            startActivity(Intent(this, LoginActivity::class.java))

        } else {
            startActivity(Intent(this, HomeActivity::class.java))
        }
        finish()
    }
}